from typing_extensions import Annotated
from fastapi import Depends, HTTPException, Request

from api.v1.service.member import MemberServiceAPI
from core.database import db_session
from service.point_service import PointService


class PointServiceAPI(PointService):
    """
    API 用于请求 PointService 实现类.  
    - 这个类是 API我们通过过度驱动实现与相关的特定异常处理.
    """
    def __init__(
            self,
            request: Request,
            db: db_session,
            member_service: Annotated[MemberServiceAPI, Depends()]
        ):
        super().__init__(request, db, member_service)

    def raise_exception(self, status_code: int, detail: str = None):
        raise HTTPException(status_code=status_code, detail=detail)
